//
//  PayTypeCell.swift
//  koolcar
//
//  Created by kuaimaxiansheng on 2023/10/18.
//

import UIKit

class PayTypeCell: UITableViewCell {
    var imgView: UIImageView!
    var titleLab: UILabel!
    var selectBtn: UIButton!
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        imgView = UIImageView.init(frame: CGRect.zero)
        imgView.image = UIImage.init(named: "icon_firstData")
        self.contentView.addSubview(imgView)
        
        titleLab = UILabel.init(frame: CGRect.init())
        titleLab.backgroundColor = UIColor.clear
        titleLab.textAlignment = .left
        titleLab.font = UIFont(name: Theme.PingFangSCRegular, size: 13)
        titleLab.textColor = Theme.titleLabColor
        self.contentView.addSubview(titleLab)
        
        self.selectBtn = UIButton(frame: CGRect(x: 14, y: 2, width: 30, height: 30))
        self.selectBtn.setImage(UIImage(named: "icon_check_normal"), for: .normal)
        self.selectBtn.setImage(UIImage(named: "icon_check_select"), for: .selected)
        self.selectBtn.isUserInteractionEnabled = false
        self.selectBtn.isSelected = true
        self.contentView.addSubview(selectBtn)
        
        
        imgView.snp.makeConstraints { make in
            make.left.equalTo(14)
            make.size.equalTo(CGSize.init(width: 18, height: 18))
            make.centerY.equalTo(26)
        }
        
        titleLab.snp.makeConstraints { make in
            make.left.equalTo(imgView.snp.right).offset(10)
            make.top.equalTo(0)
            make.height.equalTo(52)
            make.right.equalTo(0)
        }
        
        self.selectBtn.snp.makeConstraints { make in
            make.width.height.equalTo(28)
            make.right.equalTo(-14)
            make.centerY.equalTo(self.contentView.snp.centerY)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
